#include<iostream>
#include"Vector.h"
#include<vector>
#include<valarray>

using namespace std;

int main()
{
    vector<double> a = {1.0, 2.0, 0.0};
    vector<double> b = {2.0, 1.0, 0.0};
    vector<double> c = {1.0, 1.0, 0.0};
    vector<double> d = {2.0, 4.0, 0.0};
    
   
    Point<3> P1(a);
    Point<3> P2(b);
    Point<3> P3(c);
    Point<3> P4(d);
    Vector<3> V1(P1, P2);
    Vector<3> V2(P3, P4);
    Vector<3> V3 = V1 + V2;
    Vector<3> V4 = V1 - V2;
    Vector<3> V7 = -V2;
    double dist1 = V1.norm(1);
    double dist2 = V1.norm(2);
    double s = V1 * V2;
    Vector<3> V5 = V1 ^ V2;
    Point<3> Q1 = V5.getPoint(0);
    Point<3> Q2 = V5.getPoint(1);
    vector<double> t = V5.getValue();
   
    // vector<double>::iterator i_begin = V1.getValue().begin();
    // vector<double>::iterator i_end = V1.getValue().end();
    // for(vector<double>::iterator itr = i_begin; itr != i_end; itr++)
    // 	cout << *itr << endl;

    vector<double> e = {t[0], t[1], t[2]};
    Point<3> Q3(e);
    Vector<3> V6(Q3);
    cout << "V1 = " << V1 << ", V2 = " << V2 << endl;
    cout << "V1 + V2 = " << V3 << endl;
    cout << "V1 - V2 = " << V4 << endl;
    cout << "-V2 = " << V7 << endl;
    cout << "V1的1范数和2范数：" << dist1 << ", " << dist2 << endl;
    cout << "V1 * V2 = " << s << endl;
    cout << "V1 ^ V2 = " << V5 << endl;
    cout << "V5的几何信息：" << Q1 << ", " << Q2 << endl;
    cout << "V5的代数信息：" << Q3 << endl;    
    return 0;
}
